<!DOCTYPE html>
<html lang="en" xmlns:v-for="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <h1>简单的列表渲染</h1>
    <ul>
        <!-- 1. <li v-for="变量 in 数字">{{变量}}</li>-->
        <li v-for="i in 3">{{i}}</li>
    </ul>

    <ul>
        <!-- 2. <li v-for="(变量,索引) in 数字">{{变量}}-{{索引}}</li>-->
        <li v-for="(i,index) in 3">{{i}}-{{index}}</li>
    </ul>

    <!-- 3. <tr v-for="monster in 对象数组"> <td>{{monster.id}}</td> -->
   <table width="400" border="1px">
       <tr v-for="(monster,index) in monsters">
           <td>{{index}}</td>
           <td>{{monster.id}}</td>
           <td>{{monster.name}}</td>
           <td>{{monster.age}}</td>
       </tr>
   </table>
</div>

<script src="vue.js"></script>
<script>
    let vm=new Vue({
        el:"#app",
        data:{
            monsters:[{id:1,name:"牛魔王",age:800},
                    {id:2,name:"黑山老妖",age:900},
                {id:3,name:"红孩儿",age:200}
            ]
        }
    })
</script>
</body>
</html>